<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_over_times', function (Blueprint $table) {
            $table->id();
            $table->integer('department_one_id')->default(0)->comment('1级部门');
            $table->integer('department_two_id')->default(0)->comment('2级部门');
            $table->integer('department_three_id')->default(0)->comment('3级部门');
            $table->integer('sub_account_id')->nullable()->comment('子账号id');
            $table->string('sub_account')->default('')->comment('子账号');
            $table->string('service_customer')->default('')->comment('客服');
            $table->dateTime('start')->nullable()->comment('加班起始时间');
            $table->dateTime('end')->nullable()->comment('加班终止时间');
            $table->decimal('price',10,1)->default(0)->comment('加班金额');
            $table->decimal('part_price',10,1)->default(0)->comment('分部加班金额');
            $table->tinyInteger('status')->default(1)->comment('1启用2禁用');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `work_over_times` comment '加班管理'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_over_times');
    }
};
